import request from '@/utils/request'

//  GET 查询任务
export function findAllTask(params) {
  return request({
    url: '/getAllTasks',
    method: 'get',
    params: params,
  })
}

//  GET 任务分页
export function getTaskPage(params) {
  return request({
    url: '/getTaskPage',
    method: 'get',
    params: params,
  })
}

//  GET 任务列表
export function getMaterial(params) {
  return request({
    url: '/getMaterial',
    method: 'get',
    params: params,
  })
}

//  GET 
export function getMaterialByDate(params) {
  return request({
    url: '/getMaterialByDate',
    method: 'get',
    params: params,
  })
}

//  GET 同步数据
export function syncData(params) {
  return request({
    url: '/syncData',
    method: 'get',
    params: params,
  })
}

//  GET 查任务下的批次
export function findBatchByTaskId(taskId) {
  return request({
    url: '/findBatchByTaskId/'+taskId,
    method: 'get',
  })
}

//  GET 任务开启-查今天的批次
export function findBatchToday(params) {
  return request({
    url: '/findBatchToday',
    method: 'get',
  })
}

//  GET 查今天的数据
export function findMaterialToday(params) {
  return request({
    url: '/findMaterialToday',
    method: 'get',
  })
}

//  GET 开始任务
export function startTask(params) {
  return request({
    url: '/callPython',
    method: 'get',
    params: params,
  })
}

//  GET 查询结果
export function getResultByTaskId(id) {
  return request({
    url: '/getResultByTaskId/'+id,
    method: 'get',
  })
}

//  GET handleCheck
export function handleCheck(params) {
  return request({
    url: '/quartz/task/handleCheck',
    method: 'get',
  })
}

//  GET 复位
export function handleReset(params) {
  return request({
    url: '/quartz/task/reset',
    method: 'get',
  })
}


//  GET 定时任务
export function quartzGetState(params) {
  return request({
    url: '/quartz/task/getState',
    method: 'get',
  })
}

//  GET 开启定时任务
export function startQuartz(params) {
  return request({
    url: '/quartz/task/startTask',
    method: 'get',
  })
}

//  GET 关闭定时任务
export function closeQuartz(params) {
  return request({
    url: '/quartz/task/stopTask',
    method: 'get',
  })
}

//  GET 文件目录
export function getFoldList(params) {
  return request({
    url: '/getFilePath',
    // url: '/mynewbee/api/v1/index-infos',
    method: 'get',
    params: params,
  })
}

//  GET 修改文件目录
export function updateFile(params) {
  return request({
    url: '/updateFilePath',
    method: 'post',
    data: params,
  })
}

//  GET rpaTest
export function rpaClick(params) {
  return request({
    url: '/callPython',
    method: 'get',
    params: params,
  })
}

//  GET 
export function getMaterialByBatchAndGrade(params) {
  return request({
    url: '/getMaterialByBatchAndGrade',
    method: 'get',
    params: params,
  })
}